#!/usr/bin/perl

use strict;
use warnings;

use EBox;
use EBox::Config;
use EBox::GlobalImpl;

my ($module) = @ARGV;
$module or die "You must supply the name of a Zentyal module";

EBox::init();

my $global = EBox::GlobalImpl->instance();

$global->delete_dir("global/conf/modules/$module");
$global->{redis}->delete_dir("global/state/ServiceModule/$module");
$global->{redis}->delete_dir("$module/conf");
$global->{redis}->delete_dir("$module/ro");
$global->{redis}->unset("$module/state");

1;
